#include <iostream>
//系统调用
 #include <signal.h>

int main()
{
    signal(SIGCHLD, SIG_IGN);
    pid_t rpid = fork();
    if (rpid == 0)
    {
        //child
        int cnt = 5;
        while (cnt)
        {
            std::cout << "child running... " << cnt << std::endl;
            cnt--;
            sleep(1);
        }
        exit(1);
    }
    //father
    while (true)
    {
        std::cout << "father running... " << std::endl;
        sleep(1);
    }
    
    return 0;
}